package com.nineclock.common.exception;

import com.nineclock.common.enums.ResponseEnum;
import lombok.Data;

/**
 * 自定义异常
 */
@Data
public class NcException extends RuntimeException{
    private Integer code; //状态码

    public NcException(ResponseEnum responseEnum){
        super(responseEnum.getMessage());
        this.code = responseEnum.getCode();
    }

    public NcException(ResponseEnum responseEnum, Throwable throwable){
        super(responseEnum.getMessage(), throwable);
        this.code = responseEnum.getCode();
    }
}